package de.preamp.clients.java.player;

import de.preamp.clients.java.data.Track;

/**
 * @author André Stannek
 * @since 2010-08-22
 * @version 2010-08-22
 */
public interface PlaybackListener
{
    /**
     * Notifies a change of state.
     * 
     * @param track
     *            the track worked with in the new state
     * @param event
     *            the type of event that occured
     */
    void stateChanged(Track track, PreampPlayerEvent event);

    /**
     * Progress callback while playing. This method is called severals time per
     * seconds while playing.
     * 
     * @param bytesread
     *            from encoded stream.
     * @param microseconds
     *            elapsed (<b>reseted after a seek !</b>).
     */
    void progress(int bytesread, long microseconds);

    /**
     * Notifies that an internal Exception is thrown in player.
     * 
     * @param exception
     *            the exception that was thrown
     */
    void exceptionOccured(Exception exception);
}
